package cn.itcast.scala

/*
*data:2022.03.07
* author:donghui
 */

class Location(val xc:Int, val yc:Int, val zc:Int) extends Point(xc,yc) {
  var z:Int = zc

  def move(dx:Int,dy:Int,dz:Int) {
    x = x + dx
    y = y + dy
    z = z + dz

    println("x = " + x)
    println("y = " + y)
    println("z = " + z)
  }
}

object ExtendsTest {
  def main(args: Array[String]): Unit = {
    val loc = new Location(10,20,30)
    loc.move(1,2,3)
  }
}
